<template>
  <div>
    <table-view :data="tableData" header-cell-class-name="table-header" size="medium">
      <el-table-column prop="timeCycle" label="时间周期" align="center" :show-overflow-tooltip="true" />
      <el-table-column label="订单金额(元)" align="center" :show-overflow-tooltip="true">
        <template #default="{row}">
          <div style="text-align: right">
            {{ isInteger(row?.distributeAmount + row?.directAmount) }}
          </div>
        </template>
      </el-table-column>
      <el-table-column align="center" :show-overflow-tooltip="true">
        <template #header>
          配送商金额(元)
          <el-tooltip class="box-item" effect="dark" content="按市场价金额统计" placement="top-start">
            <el-button type="text">
              <i class="iconfont icon-tishi" />
            </el-button>
          </el-tooltip>
        </template>
        <template #default="{row}">
          <div style="text-align: right">
            {{ isInteger(row.distributeAmount) }}
          </div>
        </template>
      </el-table-column>
      <el-table-column align="center" :show-overflow-tooltip="true">
        <template #header>
          厂家配送金额(元)
          <el-tooltip class="box-item" effect="dark" content="按市场价金额统计" placement="top-start">
            <el-button type="text">
              <i class="iconfont icon-tishi" />
            </el-button>
          </el-tooltip>
        </template>
        <template #default="{row}">
          <div style="text-align: right">
            {{ isInteger(row.directAmount) }}
          </div>
        </template>
      </el-table-column>
    </table-view>
  </div>
</template>

<script>
import {getCurrentInstance, reactive, toRefs, watch} from 'vue'

export default {
  name: 'Index',
  props: {
    tableData: {
      type: Array,
      default: []
    }
  },
  setup(props, context) {
    const currentInstance = getCurrentInstance()

    var data = reactive({})
    watch(() => props.tableData, (newV, oldV) => {
      if (newV) {
      }
    })

    return {
      ...toRefs(data),
    }
  }
}
</script>

<style scoped>
  /* @import url(); 引入css类 */
</style>
